'use strict';
// Copyright 2014 Blueant Inc. All Rights Reserved.

/**
 * @fileoverview 材料
 * @author sundbcn@gmail.com (sun debing)
 */

var dataApi = require('../libs/dataApi');

exports.getConsumeTypeConf = function (consume_type) {
    return _getConsumeTypeConf(consume_type);
};

/**
 * 获取道具配置
 * @param  {[type]} consume_type [description]
 * @return {[type]}               [description]
 */

var _getConsumeTypeConf = function (consume_type) {
    var consume_conf = dataApi.consume.findById(consume_type);
    if (!consume_conf) {
        console.error('consume type can not found:' + consume_type);
        return;
    }
    return consume_conf;
};

/**
 * 获取材料的出售价格
 * @param  {[type]} equip_type [description]
 * @param  {[type]} lv         [description]
 * @return {[type]}            [description]
 */
exports.getConsumeSellGold = function (consume_type) {
    var consume_conf = _getConsumeTypeConf(consume_type);
    if (!consume_conf) {
        console.error('consume_conf type can not found:' + consume_type);
        return 0;
    }
    return consume_conf.price;
};
